package com.irdstudio.apicenter.gateway.web.view;


import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.irdstudio.apicenter.gateway.comm.MaccsPacket;

public class ImageView extends AbstractView {
	private static final Logger log = LoggerFactory
			.getLogger(ImageView.class);
	public ImageView(HttpServletRequest request,HttpServletResponse response, MaccsPacket packet) {
		super(request,response, packet);
	 
	}

	 
	public void renderView() {
		try {
			response.setContentType("image/jpeg");
			//设置页面不缓存
			response.setHeader("Pragma", "No-cache");
			response.setHeader("Cache-Control", "no-cache");
			response.setDateHeader("Expires", 0);
			
			if(packet==null){
				
			}
			//else
			//response.getOutputStream().write((byte[])packet.toString());
		} catch (Exception e) {
			response.setStatus(500);
			log.error("error:",e);
		}
	}


	@Override
	public String getViewData() {
		return null;
	}


	@Override
	public Map<String, Object> getMapData() {
		// TODO Auto-generated method stub
		return null;
	}
}

